package tests;

import static org.junit.Assert.*;

import model.Folder;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
 * This class tests the Folder class
 * 
 * @author buthainahaldosary
 * @since May 2013
 *
 */
public class TestFolder {
	
	Folder folder;
	/**
	 * This method is called before every test case.
	 */
	@Before
	public void setUp()
	{
		folder=new Folder("Inbox",1);
		
	}
	
	/**
	 * This method is called after every test case.
	 */
	@After
	public void tearDown()
	{
		folder=null;
		System.gc();
	}


	/**
	 * This test case tests the getName method.
	 */
	@Test
	public void testGetName() {
		assertEquals("Inbox",folder.getName());
	}

	/**
	 * This test case tests the setName method
	 */
	@Test
	public void testSetName() {
		folder.setName("Sent");
		assertEquals("Sent",folder.getName());
	}

	/**
	 * This test case tests the getUserId method
	 */
	@Test
	public void testGetUserId() {
		assertEquals(1,folder.getUserId());
	}

	/**
	 * This test case tests the setUserId method
	 */
	@Test
	public void testSetUserId() {
		folder.setUserId(2);
		assertEquals(2,folder.getUserId());
	}

	/**
	 * This test case tests the getError method
	 */
	@Test
	public void testGetError() {
		assertEquals(null,folder.getError());
	}

	/**
	 * This test case tests the setError method
	 */
	@Test
	public void testSetError() {
		folder.setError("New error");
		assertEquals("New error",folder.getError());
	}
	/**
	 * This test case tests the toString method
	 */

	@Test
	public void testToString() {
		assertEquals("",folder.toString());
	}


}
